#!/usr/bin/env python
#-*- coding:utf-8 -*-

import os
import sys
import string
import time

ISOTIMEFORMAT='%Y%m%d %X'

def Time2ISOString( s ):
    '''
    convert second to a ISO format time
    from: 23123123 to: 2006-04-12 16:46:40
    把给定的秒转化为定义的格式
    '''
    return time.strftime( ISOTIMEFORMAT, time.localtime( float( s ) ) )

def main():
    timeStr1 = sys.argv[1]
    time1 = Time2ISOString(timeStr1)
    print "%s = %s" % (timeStr1, time1)

if __name__ == '__main__':
    main()


